#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Input;
using Graphics;
#endregion

namespace Graphics3D
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class XNASceneController : SceneController
    {

        
        XNASceneLoader sceneLoader;

        public XNASceneController(Game game) : base()
        {
            this.camera = new XNACamera();
            this.renderer = new XNARenderer(game);

            this.m_aspect = (float)screenWidth / (float)screenHeight;
            this.sceneLoader = new XNASceneLoader();


        }

        public void InitGeometries()
        {
            scene = new List<Object3D>();
            sceneLoader.Load(renderer as XNARenderer, ref scene, ref camera);
        }

        /// Load your graphics content.
        public void LoadGraphicsContent(bool loadAllContent)
        {
            if (loadAllContent)
            {
                try
                {
                    InitGeometries();

                    //this.camera.Location = new ImagesMath.VR3(-725, 600, 590);//new Vector3(-725, 600, 590);
                    (this.camera as XNACamera).LookAt((scene[0]));
                }
                catch (ContentLoadException exception)
                {

                }
            }

            // TODO: Load any ResourceManagementMode.Manual content
        }




    }
}


